<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$USER = getAccountUserObject();
	$ESCORT = $this->escort_entity->init('user_id',$USER->getId());
	
	$listAllThreads = $this->escort_message_thread_entity->listAllThreadMessages($ESCORT->getId(),USER_TYPE_ESCORT);	 
	$countUnread = $this->escort_message_thread_entity->countAllUnreadMessagesOfUser($ESCORT->getId(),USER_TYPE_ESCORT);	
?>
<style>
	
	.loadingDiv{
		background:#cccccc;
		opacity:0.4
	}
	
	#browse_threads{margin-top:10px;}
</style>
 
<div id="content-left">
	<div id="personal-tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
		<div id="tabs-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
			<!-- content -->	
			<div class="dashboard-info-wrapper">
				<div id="message-thread">
					<?php 
						 $this->load->view('escorts/account/async_loadActionsLog');
					?> 
				</div>
				<div class="clear"></div>
			</div>
			
			
			<!-- end content -->
		</div>
	</div>
</div>
 

<?php $this->load->view('escorts/right_nav'); ?>



<script type="text/javascript">
	
	$(document).ready(function() { 
	
		$('#browse_threads .pagination a').live('click',function(){
			$link = $(this).attr('href');
			$('#message-thread').addClass('loadingDiv');
			$.get($link,{},function(res){$('#message-thread').removeClass('loadingDiv');;$('#message-thread').html(res);});
			return false;
		});
	});	
	
</script>